% Save the figures on hard disk

% Read the time
experiment_clock = int2str(fix(clock));

% Make a new directory and put the current time as its name
mkdir('/home/darwin/Projects/simple CICR/results',experiment_clock)

% Make a path for jpg files which are about to be created
experiment_path = strcat('/home/darwin/Projects/smc-cell/results','/',experiment_clock);

% Save the figurse as jpg files in the specified path
saveas(Ca_i_fig_handle, strcat(experiment_path,'/','Ca_i.jpg'))
saveas(Ca_JSR_fig_handle,strcat(experiment_path,'/','Ca_JSR.jpg'))
saveas(Ca_NSR_fig_handle,strcat(experiment_path,'/','Ca_NSR.jpg'))
saveas(NCX_Current_fig_handle,strcat(experiment_path,'/','NCX_Current.jpg'))
saveas(I_CaL_fig_handle,strcat(experiment_path,'/',' I_CaL.jpg'))
saveas(I_CaT_fig_handle,strcat(experiment_path,'/',' I_CaT.jpg'))
saveas(J_rel_fig_handle,strcat(experiment_path,'/',' J_rel.jpg'))
saveas(J_up_fig_handle,strcat(experiment_path,'/',' J_up.jpg'))
saveas(V_m_fig_handle,strcat(experiment_path,'/',' V_m.jpg'))

% Save the figurse in the specified path
saveas(Ca_i_fig_handle, strcat(experiment_path,'/','Ca_i.fig'))
saveas(Ca_JSR_fig_handle,strcat(experiment_path,'/','Ca_JSR.fig'))
saveas(Ca_NSR_fig_handle,strcat(experiment_path,'/','Ca_NSR.fig'))
saveas(NCX_Current_fig_handle,strcat(experiment_path,'/','NCX_Current.fig'))
saveas(I_CaL_fig_handle,strcat(experiment_path,'/',' I_CaL.fig'))
saveas(I_CaT_fig_handle,strcat(experiment_path,'/',' I_CaT.fig'))
saveas(J_rel_fig_handle,strcat(experiment_path,'/',' J_rel.fig'))
saveas(J_up_fig_handle,strcat(experiment_path,'/',' J_up.fig'))
saveas(V_m_fig_handle,strcat(experiment_path,'/',' V_m.fig')) 